# Maintainer: Gaetan Bisson <bisson@archlinux.org>

pkgname=fonts-tlwg
pkgver=0.6.5
pkgrel=1
pkgdesc='Collection of scalable Thai fonts'
url='https://linux.thai.net/projects/fonts-tlwg'
arch=('any')
license=('GPL' 'custom')
makedepends=('fontforge')
depends=('xorg-fonts-encodings' 'xorg-fonts-alias' 'xorg-font-utils' 'fontconfig')
source=("https://linux.thai.net/pub/thailinux/software/${pkgname}/${pkgname}-${pkgver}.tar.xz")
sha1sums=('1b05b5595daf7f03811de0573ab72eb85973bcf9')

conflicts=('ttf-tlwg')
provides=('ttf-tlwg')
replaces=('ttf-tlwg')

build() {
  cd ${pkgname}-${pkgver}
  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --with-ttfdir=/usr/share/fonts/TTF \

  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
  mkdir -p "$pkgdir"/etc/fonts
  mv "$pkgdir"/usr/share/fontconfig/conf.avail "$pkgdir"/etc/fonts
  rm -r "$pkgdir"/usr/share/fontconfig

  install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}
